package com.itheima.bean;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;

@Data
public class Employee implements Serializable {

    private static final long serialVersionUID = 1L;

    private Long id;

    private String username;

    private String name;

    private String password;

    private String phone;

    private String sex;

    private String idNumber;

    private Integer status;

    /*
        @TableField：设置字段属性映射
            属性：
                fill：FieldFill枚举类型 设置自动填充字段策略
                    INSERT  插入时填充字段
                    UPDATE  更新时填充字段
                    INSERT_UPDATE   插入和更新时填充字段
     */

    //只在插入时自动填充数据
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    //在插入和修改时自动填充数据
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableField(fill = FieldFill.INSERT)
    private Long createUser;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;

}
